package cn.com.bsoft.cloud.controller;

import cn.com.bsoft.cloud.controller.healthweb.HealthWebController;
import cn.com.bsoft.cloud.entity.ScheduleRecord;
import cn.com.bsoft.cloud.entity.param.ScheduleParam;
import cn.com.bsoft.cloud.model.ScheduleRecordToken;
import cn.com.bsoft.cloud.model.ScheduleRecordTokenParameter;
import cn.com.bsoft.cloud.service.ScheduleAppointmentService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/schedule/")
public class ScheduleAppointmentController {

    public static Logger logger= LogManager.getLogger(HealthWebController.class);

    @Autowired
    private ScheduleAppointmentService scheduleAppointmentService;

    @ResponseBody
    @RequestMapping("list")
    public List<ScheduleRecord> getScheduleRecordList(@RequestBody ScheduleParam map){
           List<ScheduleRecord> list = scheduleAppointmentService.getScheduleRecordList(map);
        return list;
    }

    @ResponseBody
    @RequestMapping("/getUid")
    public ScheduleRecordToken getUidForScheduleRecordId(@RequestBody ScheduleRecordTokenParameter map){
        ScheduleRecordToken scheduleRecordToken = scheduleAppointmentService.getUidForScheduleRecordId(map);
        return scheduleRecordToken;
    }

}
